package com.sgb.kjwl.api.service;

import com.sgb.kjwl.model.entity.BannerEntity;
import com.sgb.kjwl.model.entity.LeaseEntity;
import com.swgk.core.view.entity.EnterpriseEditEntity;
import com.swgk.core.view.entity.EnterpriseRecEntity;
import com.sgb.kjwl.model.entity.home.EnterpriseRecPackEntity;
import com.swgk.core.view.entity.HomeManageMenuEntity;
import com.sgb.kjwl.model.entity.home.MenuManageEntity;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;
import com.swgk.core.view.entity.MenuEntity;
import com.sgb.kjwl.model.entity.ProListEntity;
import com.sgb.kjwl.model.entity.RecommendEntity;
import com.sgb.kjwl.model.entity.StoreEntity;
import com.sgb.kjwl.model.entity.home.HomeAdEntity;
import com.sgb.kjwl.model.entity.home.SearchGoodsSummaryEntity;
import com.sgb.kjwl.model.entity.lease.CarListEntity3;
import com.sgb.kjwl.model.entity.lease.DeviceListEntity3;
import com.sgb.kjwl.model.entity.lease.MachineListEntity3;
import com.sgb.kjwl.model.entity.request.HouseFilterJson;
import com.sgb.kjwl.model.entity.request.LeaseMachineFilterJson;
import com.sgb.kjwl.model.entity.request.MachineFilterJson3;
import com.sgb.kjwl.model.entity.self.LeaseHousesEntity;
import com.swgk.core.base.model.entity.VideoBean;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.supplier3.SupplierRecommendEntity;
import com.sgb.kjwl.model.entity.transport.CarHallEntity;
import com.sgb.kjwl.model.entity.transport.SearchGoodsEntity;
import com.sgb.kjwl.model.entity.user.BigHomeAndroidEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.sgb.kjwl.model.response.ListXAResponse;
import com.swgk.core.base.model.entity.BaseEntity;
import com.sgb.kjwl.model.entity.HomeMenuEntity;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * 招采首页接口
 */
public interface BigHomeAPI {

    //Banner图片
    @POST("v2/app/index/bannerList")
    Call<BaseEntity<List<BannerEntity>>> getBanner();

    //菜单
    @POST("v2/app/index/categoryItems")
    Call<BaseEntity<List<MenuEntity>>> getCategory();

    //新大首页菜单
    @POST("v2/app/index/categoryItemsNew")
    Call<BaseEntity<List<List<MenuEntity>>>> getNewCategory();

    /**
     * 材料：material
     * 招标：recruit
     * 租赁：rent
     * 团队：team
     * 物流：logistics
     *
     * @return
     */
    //推荐类目
    @POST("v2/app/index/recomandCateV1")
    Call<BaseEntity<BigHomeAndroidEntity>> recomandCate(@Query("areaCode") String areaCode, @Query("code") String code);

    /**
     * 大首页1.8添加 接口与ios保持一致
     * code值：
     * 材料：material
     * 招标：recruit
     * 集采：groupbuy
     * 租赁市场：rent
     * 工程建设：team
     * 物流货运：logistics
     * 知识分享：college
     */
    //推荐类目
    @POST("v2/app/index/recomandCate")
    Call<BaseEntity<List<BigHomeAndroidEntity>>> recomandCate2(@Query("areaCode") String areaCode, @Query("code") String code);

    @POST("v2/app/index/getAllRecomandCate")
    Call<BaseEntity<List<HomeMenuEntity>>> getAllRecomandCate();

    @POST("v2/app/index/searchByKeyword")
    Call<BaseEntity<ProListEntity<List<SearchGoodsEntity>>>> searchLogisticGoods(@Body Map map);

    @POST("v2/app/index/searchByKeyword")
    Call<BaseEntity<ProListEntity<List<CarHallEntity>>>> searchLogisticCars(@Body Map map);

    @POST("v2/app/index/searchByKeyword")
    Call<BaseEntity<ProListEntity<List<RecommendEntity>>>> searchGoods(@Body Map map);

    @POST("v2/app/index/searchByKeyword")
    Call<BaseEntity<ProListEntity<List<StoreEntity>>>> searchCompany(@Body Map map);

    //热门分享
    @POST("v1/app/collegeV1/getFirstPageVideoList")
    Call<BaseEntity<ListXAResponse<List<VideoBean>>>> getFirstPageVideoList(@Body Map map);

    //知识分享视频分类查询
    @GET("v1/app/collegeV1/videoTypeList1")
    Call<BaseEntity<List<MenuEntity>>> videoTypeList();

    //大首页分类下面的视频
    @GET("v1/app/collegeV1/getVideoListByType1")
    Call<BaseEntity<ProListEntity<List<VideoBean>>>> getVideoListByType(@Query("type") String type,@Query("pageNum") Integer pageNum,@Query("pageSize") Integer pageSize);

    //大首页获取机械分类
    @POST("v1/app/machinery/firstCategory")
    Call<BaseEntity<List<DictEntity3>>> getMachineFilterType();

    //大首页获取机械列表
    @POST("v1/app/machinery/rentListV1Index")
    Call<BaseEntity<ListResponse<List<MachineListEntity3>>>> getMachineList3(@Body MachineFilterJson3 machineFilterJson3);

    //大首页机械页面出租列表
    @FormUrlEncoded
    @POST("v1/app/machinery/wantList")
    Call<BaseEntity<List<LeaseEntity>>> getRentMachineList(@Body MachineFilterJson3 machineFilterJson3);

    //大首页获取设备分类
    @POST("v1/app/equipment/equipmentFirstCategory")
    Call<BaseEntity<List<DictEntity3>>> getDeviceFilterType();

    //大首页获取设备列表
    @POST("v1/app/equipment/equipmentListV1")
    Call<BaseEntity<ListResponse<List<DeviceListEntity3>>>> getDeviceList3(@Body MachineFilterJson3 machineFilterJson3);

    //获取车辆分类
    @POST("v1/app/car/carModel")
    Call<BaseEntity<List<DictEntity3>>> getCarFilterType();

    //获取车辆列表
    @POST("v1/app/car/rentList")
    Call<BaseEntity<ListResponse<List<CarListEntity3>>>> getCarList3(@Body MachineFilterJson3 machineFilterJson3);

    //房产出租筛选列表
    @POST("v1/app/estateRent/getAllList")
    Call<BaseEntity<ListResponse<List<LeaseHousesEntity>>>> getHouse(@Body HouseFilterJson filterJson);

    //房产一级分类
    @POST("v1/app/estate/getParentEstateType")
    Call<BaseEntity<List<DictEntity3>>> getParentEstateType();

    //大首页发现供应商列表
    @POST("v1/app/material/supplier/getSupplierList")
    Call<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getSupplierList(@Body Map map);

    //大首页机械页面出租列表
    @POST("v1/app/leasepublic/getRentLeaseAll")
    Call<BaseEntity<ListResponse<List<MachineListEntity3>>>> getRentLeaseAll(@Body LeaseMachineFilterJson filterJson);

    //搜索商品二级分类
    @POST("v1/app/index/summary")
    Call<BaseEntity<SearchGoodsSummaryEntity>> getGoodsSummary(@Body Map map);

    @GET
    @Headers("tokenType:pc")
    Call<BaseEntity<HomeAdEntity>> getHomeAdData(@Url String url);

    //获取首页企业推荐列表
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @GET("v1/app/index/getAllIndexList")
    Call<BaseEntity<List<EnterpriseRecEntity>>> getEnterpriseRecList(@Query("type") String type,@Query ("areaCode")int areaCode);

    //获取首页企业菜单列表
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @GET("v1/app/index/getIndexCompanyTitle")
    Call<BaseEntity<List<EnterpriseEditEntity>>> getEnterpriseMenuList();

    //获取首页企业推荐列表
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @GET("v1/app/index/getAllIndexListNew")
    Call<BaseEntity<List<EnterpriseEditEntity>>> getEnterpriseRecListNew(@Query("areaCode") Integer type);

    //新增-编辑首页推荐列表
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @POST("v1/app/index/addIndexCompanyList")
    Call<BaseEntity<List<EnterpriseRecEntity>>> editEnterpriseConfigList(@Body EnterpriseEditEntity entity);

    //新首页金刚区列表
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @GET("v1/app/index/findIconByCode")
    Call<BaseEntity<MenuManageEntity<List<HomeManageMenuEntity>>>> getHomeMenuList(@Query("code") String type);

    //根据类型获取首页企业列表(分页)
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @POST("v1/app/index/getAllIndexPage")
    Call<BaseEntity<EnterpriseRecPackEntity>> getCompanyListByType(@Body Map map);
}